package com.cuijq.ms.springfactory;

import java.util.ArrayList;
import java.util.List;
import lombok.Data;

/**
 * @Classname BeanDefinition
 * @Description TODO
 * @Date 2021/5/6 11:35
 * @Created by CuiJQ
 */
@Data
public class BeanDefinition {

  private String id;
  private String className;
  private List<ConstructorArg> constructorArgs = new ArrayList<>();
  private Scope scope = Scope.SINGLETON;
  private boolean lazyInit = false;

  // 省略必要的getter/setter/constructors
  public boolean isSingleton() {
    return scope.equals(Scope.SINGLETON);
  }

  public static enum Scope {SINGLETON, PROTOTYPE}

  @Data
  public static class ConstructorArg {

    private boolean isRef;
    private Class type;
    private Object arg;

  }

}
